package section_10.newIO;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;

public class TransferTo {
	@SuppressWarnings("resource")
	public static void main(String[] args) throws IOException {
		FileChannel in = new FileInputStream("src/section_10//newIO//TransferTo.java").getChannel(),
				out = new FileOutputStream("TransferTo.txt").getChannel();
		in.transferTo(0, in.size(), out);
		
//		Or
//		out.transferFrom(in,0,in.size());
	}
}
